<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
     function PipeLine(){
            this.List=[]
            this.jude = false
            this.on = (name,func)=>{
                       this.List.push({'name':name,'func':func})
            }
            this.run = ()=>{
                for(var i in this.List){
                    this.jude =false
                         this.List[i].func(this.List[i],()=>{
                               this.jude = true
                         })
                    if(this.jude == false){
                          break;
                    }
                }
            }
     }
   const pipe = new PipeLine();
     pipe.on('start',(ctx,next)=>{
            console.log(ctx.name);
            next();
     })
     pipe.on('progress',(ctx,next)=>{
         console.log(ctx.name);
         next();
     })
     pipe.on('end',(ctx,next)=>{
         console.log(ctx.name);
     })
     pipe.run()
</script>
</body>
</html>